Class DOMParser

Summary

Fully Qualified Name: CodeIgniter\Test\DOMParser

Description

Load a response into a DOMDocument for testing assertions based on that

Methods

Name Description Defined By
__construct() Constructor. DOMParser
dontSee() Checks to see if the text is NOT found within the result. DOMParser
dontSeeElement() Checks to see if the element is available within the result. DOMParser
getBody() Returns the body of the current document. DOMParser
parseSelector() Look for the a selector in the passed text. DOMParser
see() Checks to see if the text is found within the result. DOMParser
seeCheckboxIsChecked() Checks for checkboxes that are currently checked. DOMParser
seeElement() Checks to see if an element with the matching CSS specifier is found within the current DOM. DOMParser
seeInField() Checks for an input named $field with a value of $value. DOMParser
seeLink() Determines if a link with the specified text is found within the results. DOMParser
withFile() Loads the contents of a file as a string so that we can work with it. DOMParser
withString() Sets a string as the body that we want to work with. DOMParser

Method Details

__construct()

Constructor.

Returns:

dontSee()

Checks to see if the text is NOT found within the result.

Parameter Name Type Description
$search string
$element string|null

Returns: bool

dontSeeElement()

Checks to see if the element is available within the result.

Parameter Name Type Description
$element string

Returns: bool

getBody()

Returns the body of the current document.

Returns: string

parseSelector()

Look for the a selector in the passed text.

Parameter Name Type Description
$selector string

Returns: \type

see()

Checks to see if the text is found within the result.

Parameter Name Type Description
$search string
$element string

Returns: bool

seeCheckboxIsChecked()

Checks for checkboxes that are currently checked.

Parameter Name Type Description
$element string

Returns: bool

seeElement()

Checks to see if an element with the matching CSS specifier is found within the current DOM.

Parameter Name Type Description
$element string

Returns: bool

seeInField()

Checks for an input named $field with a value of $value.

Parameter Name Type Description
$field string
$value string

Returns: bool

seeLink()

Determines if a link with the specified text is found within the results.

Parameter Name Type Description
$text string
$details string|null

Returns: bool

withFile()

Loads the contents of a file as a string so that we can work with it.

Parameter Name Type Description
$path string

Returns: \CodeIgniter\Test\DOMParser

withString()

Sets a string as the body that we want to work with.

Parameter Name Type Description
$content string

Returns: $this

Top